home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / hypercar / mactool / thinkcgu.sit / TC Prog Guide / card_36204.txt < prev    next >
Encoding:
Text File  |  1991-02-27  |  1.4 KB  |  36 lines

  1. -- card: 36204 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. The 'indirect' specifier indicates how TC implements objects of this class, and is discussed later*.  It is not used in C++.  The 'virtual' specifier mentioned in the comments is for C++ only.  Its purpose is mentioned later in this section.
  11.  
  12. The set() and print() methods are defined using the new SCOPE RESOLUTION operator,    '::'.  This associates the function definitions with the appropriate class.  For example:
  13.  
  14.     void    Person::set(void)
  15.     {
  16.         age = 62;
  17.         weight = 155;
  18.     }
  19.  
  20. The instance variables declared in the Person class are accessible from within the body of the member function definitions without need for the '.' or '->' operators usually needed to access structure members.  However, if a method definition uses a local variable with the same identifier as an instance variable, the instance variable can be accessed using the automatically-declared 'this' pointer, e.g.:  this->age = 62.
  21.  
  22. -- part contents for background part 7
  23. ----- text -----
  24. 107
  25.  
  26. -- part contents for background part 29
  27. ----- text -----
  28. 38494
  29.  
  30. -- part contents for background part 27
  31. ----- text -----
  32. Macintosh memory management
  33.  
  34. -- part contents for background part 20
  35. ----- text -----
  36. Macintosh memory management - p123